package mess;

import java.util.Arrays;

public class LeeCode_2357 {
    public static void main(String[] args) {
        System.out.println(minimumOperations(new int[]{1, 5, 0, 3, 5}));
        System.out.println(minimumOperations(new int[]{0}));
    }

    private static int minimumOperations(int[] nums) {
        Arrays.sort(nums);
        int len = nums.length;
        int index = 0;
        int count = 0;
        while (index < len){
            int num = nums[index];
            if (num != 0){
                for (int i = 0; i < len; i++) {
                    nums[i] -= num;
                }
                count++;
            }
            index++;
        }
        return count;
    }
}
